package com.itheima.io1.mybyteststream2;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

/**
 * @author zhangbaiyan
 * @date 2024-09-20 13:31
 * @description:
 * @version:
 */
public class kaobei2 {
    public static void main(String[] args) throws IOException {
        //1.创建对象
        FileInputStream fis = new FileInputStream("C:\\Users\\17685\\Desktop\\截图20240919145018.png");
        FileOutputStream fos = new FileOutputStream("r.png");
        //2.拷贝
        int len;
        byte[] bytes=new byte[1024*1024*5];
        while((len=fis.read(bytes))!=-1){
            fos.write(bytes,0,len);
        }

        //3.释放资源
        fos.close();
        fis.close();
    }
}
